The Cascading Bridge Design Pattern
نویسنده
چکیده
public class AppStore { public static AppStore current() {return current;} public static void install(AppStore as) {current=as;} private static AppStore current; abstract public void commit(Application app); abstract Application retrieve(int id); }public void commit(Application app); abstract Application retrieve(int id); } It has methods for maintaining the current handler (current, install), as well as abstract methods provided for the benefit of the domain model. A simple implementation of AppStore stores Applications in memory: public class AppMemStore extends AppStore { private Hashtable apps = new Hashtable(); public void commit(Application app) { apps.put(new Integer(app.getId()),app); } Application retrieve(int id) { return (Application)apps.get(new Integer(id)); } } A simple application would use an AppMemStore directly: public class Client { static void init() { AppStore.install(new AppMemStore()); } static void test() { Application a1 = new Application(1,"barnie"); a1.commit(); Application a2 = Application.retrieve(1); ... // compare a1 and a2 } public static final void main(String[] argv) { init(); test(); } } If instead a remote connection is desired, the Client.init routine simply installs an appropriate subclass of AppStore: public class Client { static void init() { AppStore.install(new AppRMI()); } ... // same as before } AppRMI communicates to the server using RMI. Here we assume class AppRemote has been defined and had a client stub generated with standard RMI development tools. AppRMI then forwards requests to an AppRemote instance (potentially having to deal with network failures which are ignored here): public class AppRMI extends AppStore {
منابع مشابه
Cascading Web Services to Bridge Wired and Wireless Networks for Data Transactions
This paper describes and introduces „Cascading Web Services‟ representing a collection of services offered in a system of multiple interacting and platform independent networks. Cascading Web Services are demonstrated as a technical design solution to the communication of devices using request-respond commands by cascading these commands between different Web Services. These services are self-c...
متن کاملUsing Dual Cascading Learning Frameworks for Image Indexing
To bridge the semantic gap in content-based image retrieval, detecting meaningful visual entities (e.g. faces, sky, foliage, buildings etc) in image content and classifying images into semantic categories based on trained pattern classifiers have become active research trends. In this paper, we present dual cascading learning frameworks that extract and combine intraimage and inter-class semant...
متن کاملبررسی عددی اثرات مقیاس بر الگوی جریان اطراف پایههای پل مستطیلی با استفاده از نرمافزار فلوئنت
Flow pattern around the bridge piers includes water surface profile, velocity profile, shear velocity, shear stress distribution, etc. In this research, the effects of the base shape along with scale effects on the flow pattern around the rectangular bridge piers were numerically calculated through "Fluent Software", using Horizontal Velocity Distribution (Vx) and Vertical Velocity Distribution...
متن کاملAnalysis of Flow Pattern with Low Reynolds Number around Different Shapes of Bridge Piers, and Determination of Hydrodynamic Forces, using Open Foam Software
In many cases, a set of obstacles, such as bridge piers and abutments, are located in the river waterway. Bridge piers disrupt river’s normal flow, and the created turbulence and disturbance causes diversion of flow lines and creates rotational flow. Geometric shape and position of the piers with respect to flow direction and also number of piers and their spacing are effective on changing the ...
متن کاملPromoting city center parking qualities using urban design guidelines
Quality is the most important consequence of an urban design project, and its promotion is the final duty of an urban designer. So "urban design guidelines" which use environmental improvement factors in their structure, have an effective role in promoting urban space quality. "Urban design guidelines" are the most important instruments in urban designers' authority, to reflect and appear im...
متن کامل